A “snapshot instance” (or simply “snapshot”) as used in the computer storage art represents a state of the information stored on a volume of storage media at the time this instance was created. From a file system point of view, a snapshot instance preserves the structure of the file system operating on the corresponding volume. Snapshot software is designed to interface with file systems and block (storage) devices to provide snapshot functions, namely snapshot creation, snapshot deletion and snapshot restoration.
To maintain the state of snapshot instances, when a write operation occurs on a volume, the snapshot software will typically receive a notification event. Snapshot software can copy the data on the block to other free space when needed. The method is commonly referred to as “copy-on-write.” To achieve good space utilization, it is desirable to keep the “copy-on-write” backup data on the same volume.
However, there are problems associated with maintaining multiple snapshot instances while performing “copy-on-write” operations and snapshot functions on the same volume. One problem is that every “copy-on-write” process needs free space on the volume to store the copy-on-write protected data. Free space is simply a block that is currently not used by file-system and all snapshot instances created on the volume.
With prior systems, each snapshot instance has its own set of free space, referred to as a differential file. The differential file contains all modifications to the data since a past time (the original data). In order to recover the data from the past time, the current data and the differential file are integrated to recreate the original data. As more and more snapshot instances created, the number of differential files grows. Since each differential file uses its own free space, this would cause adverse effect to free space utilization. On the other hand, it is not trivial for multiple snapshot instances to share copy-on-write protected data. When one of the snapshot instances is deleted, these copy-on-write protected data stored on its differential file may need to be moved to other differential files.
Free space identification is another problem. With prior systems, multiple file-system allocation bitmaps need to be created for each snapshot instance to identify free space. Another problem arises when the need for snapshot restoration emerges. The system needs to maintain all other snapshot instances while the file-system is reverted to the state of one snapshot instance. Prior systems are not designed for this kind of application and does not provide a snapshot restoration mechanism.
An efficient mechanism for providing creation, deletion and restoration functions on multiple snapshot instances of a volume is thus presented herein.